package com.ynet.finmall.company.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * 注解的Handler
 */
@Controller
public class ExampleController {

	private static final Logger logger = LoggerFactory.getLogger(ExampleController.class);

	@Value("${redis.ip}")
	private String redisIp;
	
	@Value("${redis.post:8080}")
	private String redisPost;
	
    @RequestMapping("/query")
    public void queryItem(HttpServletRequest request, HttpServletResponse response) throws IOException {

    	logger.debug("redis ip: " + redisIp + " redis post: " + redisPost);
    	
        PrintWriter out = response.getWriter();
        out.println("redis ip: " + redisIp);
        out.println("redis post: " + redisPost);
        out.flush();
        out.close();
    }


}
